package com.ihr360.message.dto;

import com.ihr360.commons.model.entity.StringIdWithTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 消息发送记录
 *
 * @author tom
 * @date 17-12-28
 */
@Entity
@Table(name = "tab_message_send_record")
public class MessageSendRecordDto extends StringIdWithTime {

    public static class SendStatus {
        public final static int DEFAULT = 0;
        public final static int SUBMIT_SUCCESS = 1;
        public final static int SUBMIT_FAILED = -1;
        public final static int SEND_SUCCESS = 2;
        public final static int SEND_FAILED = -2;
    }

    @Column(length = 40)
    private String taskId;

    /**
     * 通讯Id
     * 微信openId、短信mobile...
     */
    @Column(length = 50, nullable = false)
    private String sendId;

    /**
     * 消息模板占位符，及替换的文本 json 格式
     */
    @Column(length = 500)
    private String placeholderValues;

    /**
     * 成功数
     */
    @Column(length = 10, nullable = false)
    private Integer success_count;

    /**
     * 失败数
     */
    @Column(length = 10, nullable = false)
    private Integer failure_count;

    /**
     * 消息内容
     */
    @Column(columnDefinition = "MEDIUMTEXT")
    private String content;

    /**
     * 发送状态
     */
    @Column(length = 10, nullable = false)
    private Integer sendStatus;

    /**
     * 失败原因
     */
    @Column(length = 500)
    private String failedReason;

    /**
     * 供应商备案的消息模板Id
     * 微信，短信供应商...
     */
    @Column(length = 200)
    private String vendorTemplateId;

    /**
     * rowId
     */
    @Column
    private String spreaadsheetRowId;

    /**
     * 标题
     */
    @Column
    private String title;

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getSendId() {
        return sendId;
    }

    public void setSendId(String sendId) {
        this.sendId = sendId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(Integer sendStatus) {
        this.sendStatus = sendStatus;
    }

    public String getFailedReason() {
        return failedReason;
    }

    public void setFailedReason(String failedReason) {
        this.failedReason = failedReason;
    }

    public String getPlaceholderValues() {
        return placeholderValues;
    }

    public void setPlaceholderValues(String placeholderValues) {
        this.placeholderValues = placeholderValues;
    }

    public String getVendorTemplateId() {
        return vendorTemplateId;
    }

    public void setVendorTemplateId(String vendorTemplateId) {
        this.vendorTemplateId = vendorTemplateId;
    }

    public Integer getSuccess_count() {
        return success_count;
    }

    public void setSuccess_count(Integer success_count) {
        this.success_count = success_count;
    }

    public Integer getFailure_count() {
        return failure_count;
    }

    public void setFailure_count(Integer failure_count) {
        this.failure_count = failure_count;
    }

    public String getSpreaadsheetRowId() {
        return spreaadsheetRowId;
    }

    public void setSpreaadsheetRowId(String spreaadsheetRowId) {
        this.spreaadsheetRowId = spreaadsheetRowId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
